/**
 * @Author：ming
 * @Date：2023/9/26 7:47 PM
 * @Filename：lc191
 */

/**
 * @author ming
 */
public class lc191 {
    public int hammingWeight(int n) {
        int count = 0;

        for (int i = 0; i < 32; i++) {
            if((n&1)==1){
                count++;
            }
            n = n>>>1;
        }

        return count;
    }
}
